/**
 * 
 */
package uni_due.vowoche.view.adapter;

import java.util.ArrayList;

import uni_due.vowoche.R;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

/**
 * @author manhhung.vu
 */
public class MainActViewApt extends BaseAdapter
{
	//=====================================================================//
	//Properties
	//---------------------------------------------------------------------//
	private Context mContext;
	private ArrayList<String> mViewItems;
	
	
	//=====================================================================//
	//Contrustors & Methods
	//---------------------------------------------------------------------//
	public MainActViewApt(Context context) {
		// TODO Auto-generated constructor stub
		mContext = context;
		
		if (mViewItems == null) loadViewItems();
	}
	
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mViewItems.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		
		TextView txtView = null;
		if (convertView == null) 
		{
			txtView = new TextView(mContext);
			txtView.setText(mViewItems.get(position));
		}
		else txtView = (TextView) convertView;
		
		return txtView;
	}
	
	
	//=====================================================================//
	//Own Methods
	//---------------------------------------------------------------------//
	private void loadViewItems()
	{
		mViewItems = new ArrayList<String>(7);
		mViewItems.add(mContext.getString(R.string.mainView_itemText_finder));
		mViewItems.add(mContext.getString(R.string.mainView_itemText_explorer));
		mViewItems.add(mContext.getString(R.string.mainView_itemText_schedule));
		mViewItems.add(mContext.getString(R.string.mainView_itemText_events));
		mViewItems.add(mContext.getString(R.string.mainView_itemText_tutorials));
		mViewItems.add(mContext.getString(R.string.mainView_itemText_qr));
		mViewItems.add(mContext.getString(R.string.mainView_itemText_makeFriends));
	}
}
